package com.baymax.study.tuLing.bio;

import lombok.Data;

import java.io.FileReader;
import java.io.IOException;
import java.util.Properties;

/**
 * Demo03_Property
 *
 * @author Baymax Gu
 * @since 2024-09-14
 */
public class Demo03_Property {
    public static void main(String[] args) throws IOException {
        Properties prop = new Properties();
        prop.load(new FileReader("d:\\mytemp\\dog.properties"));
        Dog dog = new Dog();
        dog.setName(prop.getProperty("name"));
        dog.setAge(Integer.parseInt(prop.getProperty("age")));
        dog.setColor(prop.getProperty("color"));
        System.out.println(dog);
    }
}

@Data
class Dog {
    private String name;

    private int age;

    private String color;
}
